// { label: '工单信息', value: 0, actvie: true },
// { label: '客户信息', value: 1, actvie: false },
// { label: '车辆信息', value: 2, actvie: false },
// { label: '工单项目列表', value: 3, actvie: false },
// { label: '工单配件列表', value: 4, actvie: false },
// { label: '工单精品列表', value: 5, actvie: false },
// { label: '签字记录', value: 6, actvie: false },
// { label: '工单返工列表', value: 7, actvie: false },
// { label: '工单退料', value: 8, actvie: false },
import {
  getRapidById, rapidFindById, getRapidDispatch, rapidProjectList,
  rapidPartsPage, rapidProjectReworkSave, rapidInsProject, rapidReturnMaterial, rapidProjectReworkPage
} from '@/api/after-sale/workOrderManage/fast';//快速单子api
import {
  getWashById, editWashDetail, washDispatchID, washProjectPage,
  washProjectReworkSave, washInsProject, washProjectReworkPage
} from '@/api/after-sale/workOrderManage/car-wash';//洗车单子api
import {
  getSynthesizeById, synthesizeFindById, synthesizeDispatch,
  synthesizeProjectPage, synthesizePartsPage, synthesizeJpPage,
  synthesizeInsProject, reworkSave, synthesizeReturnMaterial, synthesizeReturnJpMaterial,
  synthesizeChangeJpMaterial, synthesizeChangePartsMaterial,synthesizeProjectReworkPage
} from '@/api/after-sale/workOrderManage/comprehensive';//综合单api
import {
  getQuoteDetail, quoteProjectPage, quoteJpPage,
  getQuoteById
} from '@/api/after-sale/workOrderManage/quotation';//报价单
import {
  getSellById, sellJpPage, sellPartsPage, sellReturnMaterial,
  getSellFindById, sellReturnJpMaterial, sellChangeJpMaterial, sellChangePartsMaterial,getSellDispatch
} from '@/api/after-sale/workOrderManage/sell';//销售单
import {
  outStoragePartsDetailPage
} from '@/api/after-sale/storehouseManage/outOfStockManage';//配件查询接口--公共


import authority from './authorityConfig';

export const orderTypeData = [
  { value: '快速单', key: 1 },
  { value: '洗车单', key: 2 },
  { value: '综合单', key: 3 },
  { value: '报价单', key: 4 },
  { value: '销售单', key: 5 },
  { value: '保险单', key: 6 },
  { value: '接车单', key: 7 },
]

/**
 * notMenuButton 弹窗上不显示的按钮
 * getOrderInfo 工单详情接口
 * orderStatusListField 工单进度状态显示字段
 * orderDispatch 工单派单方法
 * orderProjectList 工单项目列表查询方法
 *     query 方法
 *     queryField 查询字段
 * orderFittingList 工单配件列表查询方法
 * orderReturnFittingList 工单配件退料查询方法和字段  包含退料 快速单 综合单 销售单
 *     query 
 *     queryField 
 *     save  退料保存接口
 * orderBoutiqueList 工单精品查询方法和字段 
 *     query 
 *     queryField 
 * orderReworkList 工单返工列表查询
 * orderReworkSave 返工保存
 *     query 
 *     queryField 
 * orderInsProject 工单增项
 *  save保存
 */
var config = {
  //快速单
  workOrderType1: {
    notMenuButton: [5],
    getOrderInfo: getRapidById,
    orderStatusListField: 'orderRapidStatusList',
    orderDispatch: getRapidDispatch,
    orderProjectList: {
      query: rapidProjectList,
      queryField: 'orderRapidId',
    },
    orderFittingList: outStoragePartsDetailPage,
    orderReturnFittingList: {
      query: rapidPartsPage,
      queryField: 'rapidId',
      save: rapidReturnMaterial,
    },
    orderBoutiqueList: {
      query: '',
      queryField: '',
    },
    orderReworkList: {
      query: rapidProjectReworkPage,
      queryField: 'orderRapidId',
    },
    orderReworkSave: {
      save: rapidProjectReworkSave,
    },
    orderInsProject: {
      save: rapidInsProject,
    },
    getDeatilById: rapidFindById,
    authority: authority(1),
  },
  //洗车单子
  workOrderType2: {
    notMenuButton: [4, 8, 5],
    getOrderInfo: getWashById,
    orderStatusListField: 'orderWashStatusList',
    orderDispatch: washDispatchID,
    orderProjectList: {
      query: washProjectPage,
      queryField: 'orderWashId',
    },
    orderFittingList: '',
    orderReturnFittingList: {
      query: '',
      queryField: '',
    },
    orderBoutiqueList: {
      query: '',
      queryField: '',
    },
    orderReworkList: {
      query: washProjectReworkPage,
      queryField: 'orderWashId',
    },
    orderReworkSave: {
      save: washProjectReworkSave,
    },
    orderInsProject: {
      save: washInsProject,
    },
    getDeatilById: editWashDetail,
    authority: authority(2),
  },
  //综合单
  workOrderType3: {
    notMenuButton: [],
    getOrderInfo: getSynthesizeById,
    orderStatusListField: 'statusList',
    orderDispatch: synthesizeDispatch,
    orderProjectList: {
      query: synthesizeProjectPage,
      queryField: 'orderSynthesizeId',
    },
    orderFittingList: outStoragePartsDetailPage,
    orderReturnFittingList: {
      query: synthesizePartsPage,
      queryField: 'synthesizeId',
      save: synthesizeReturnMaterial,
    },
    orderBoutiqueList: {
      query: synthesizeJpPage,
      queryField: 'synthesizeId',
      save: synthesizeReturnJpMaterial,
    },
    orderChangeFittingList: {
      query: synthesizePartsPage,
      queryField: 'synthesizeId',
      save: synthesizeChangePartsMaterial,
    },
    orderChangeBoutiqueList: {
      query: synthesizeJpPage,
      queryField: 'synthesizeId',
      save: synthesizeChangeJpMaterial,
    },
    orderReworkList: {
      query: synthesizeProjectReworkPage,
      queryField: 'orderSynthesizeId',
    },
    orderReworkSave: {
      save: reworkSave,
    },
    orderInsProject: {
      save: synthesizeInsProject,
    },
    getDeatilById: synthesizeFindById,
    authority: authority(3),

  },
  //报价单
  workOrderType4: {
    notMenuButton: [1, 2, , 6, 7, 8],
    getOrderInfo: getQuoteDetail,
    orderStatusListField: '',
    orderDispatch: '',
    orderProjectList: {
      query: quoteProjectPage,
      queryField: 'quoteId',
    },
    orderFittingList: outStoragePartsDetailPage,
    orderReturnFittingList: {
      query: '',
      queryField: '',
    },
    orderBoutiqueList: {
      query: quoteJpPage,
      queryField: 'quoteId',
    },
    orderReworkList: {
      query: '',
      queryField: '',
    },
    getDeatilById: getQuoteById,
    authority: authority(4),
  },
  //销售单
  workOrderType5: {
    notMenuButton: [2, 3, 7],
    getOrderInfo: getSellById,
    orderStatusListField: 'orderSellStatusList',
    orderDispatch: getSellDispatch,
    orderProjectList: {
      query: '',
      queryField: '',
    },
    orderFittingList: outStoragePartsDetailPage,
    //销售单退料查询接口缺失
    orderReturnFittingList: {
      query: sellPartsPage,
      queryField: 'sellId',
      save: sellReturnMaterial,
    },
    orderBoutiqueList: {
      query: sellJpPage,
      queryField: 'sellId',
      save: sellReturnJpMaterial,
    },
    orderChangeFittingList: {
      query: sellPartsPage,
      queryField: 'sellId',
      save: sellChangePartsMaterial,
    },
    orderChangeBoutiqueList: {
      query: sellJpPage,
      queryField: 'sellId',
      save: sellChangeJpMaterial,
    },
    orderReworkList: {
      query: '',
      queryField: '',
    },
    getDeatilById: getSellFindById,
    authority: authority(5),
  },
}
export default config;